This document briefly describes the files of the reproducible code corresponding to the paper 'ecolRxC: Ecological inference estimation of R×C tables using latent structure approaches'. For each file, the interested reader will find two versions: an Rmd file and an HTML file. The Rmd file contains the RMarkdown code to be run, and the HTML file is the result obtained after knitting the Rmd file.

The code is reproducible using R, and the necessary packages to replicate de code are: ecolRxC, ei.Datasets and tidyverse.

The computations in the paper has been performed using:
## R version 4.3.0 (2023-04-21 ucrt)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 11 x64 (build 22631)
After loading the versions 0.0.1-3 of ei.Datasets, 0.1.1-11 of ecolRxC and 2.0.0 of tidyverse. 

To replicate the results a proper order of runing the code is:
ecolRxC_accuracy_IPF.Rmd
ecolRxC_accuracy_Thomsen_logit_no_aprox.Rmd
ecolRxC_accuracy_Thomsen_logit_Yule_aprox.Rmd
ecolRxC_accuracy_Thomsen_probit_no_aprox.Rmd
ecolRxC_accuracy_Thomsen_probit_Yule_aprox.Rmd
Figure_2.Rmd
Figure_3.Rmd
Section_4_and_Online_appendix_III.Rmd
Table_2_and_tables_in_Online_appendix_IV.Rmd
Table_3_and_tables_in_Online_appendix_V.Rmd

The first five listed Rmd files produce as outputs the set of files ("summary_ecolRxC_solutions_IPF.csv", "summary_ecolRxC_solutions_Thomsen_logit_FALSE.csv", "summary_ecolRxC_solutions_Thomsen_logit_TRUE.csv", "summary_ecolRxC_solutions_Thomsen_probit_FALSE.csv", "pjk_ecolRxC_predictions_Thomsen_probit_FALSE.csv" and "summary_ecolRxC_solutions_Thomsen_probit_TRUE.csv") that, being also available in this repository, are the inputs of the second five listed Rmd files. This second set of files generate the Figures and the files containing the numbers of the Tables displayed in the paper and in the supplementary material: "Figure2_data.csv", "Figura2.tiff", "EI_logit.csv", "EI_ probit.csv", "EPW_logit.csv", "EPW_probit.csv", "EQ_logit.csv", "EQ_probit.csv", "Figure3.tiff", "EI_composite.csv", "EPW_composite.csv", "EQ_composite.csv". 


Description of files:

ecolRxC_accuracy_IPF.Rmd, ecolRxC_accuracy_IPF.html
This document contains the reproducible code that produces the measures of accuracy corresponding to the estimates attained with the function ecolRxC() of the ecolRxC package with argument `method = "IPF" when applied to the datasets available in ei.Datasets. These measures of accuracy are saved in the file "summary_ecolRxC_solutions_IPF.csv". The data saved in "summary_ecolRxC_solutions_IPF.csv" is used in producing Figure 2 and Table 2 in the paper and the tables in Online appendix IV.

ecolRxC_accuracy_Thomsen_logit_no_aprox.Rmd, ecolRxC_accuracy_Thomsen_logit_no_aprox.html
This document contains the reproducible code that produces the measures of accuracy corresponding to the estimates attained with the function ecolRxC() of the ecolRxC package with arguments method = "Thomsen", scale = "logit" and Yule.aprox = FALSE when applied to the datasets available in ei.Datasets. These measures of accuracy are saved in the file "summary_ecolRxC_solutions_Thomsen_logit_FALSE.csv". The data saved in "summary_ecolRxC_solutions_Thomsen_logit_FALSE.csv" is used in producing Figure 2 and Table 2 in the paper and the tables in Online appendix IV.

ecolRxC_accuracy_Thomsen_logit_Yule_aprox.Rmd, ecolRxC_accuracy_Thomsen_logit_Yule_aprox.html
This document contains the reproducible code that produces the measures of accuracy corresponding to the estimates attained with the function ecolRxC() of the ecolRxC package with arguments method = "Thomsen", scale = "logit" and Yule.aprox = TRUE when applied to the datasets available in ei.Datasets. These measures of accuracy are saved in the file "summary_ecolRxC_solutions_Thomsen_logit_TRUE.csv". The data saved in "summary_ecolRxC_solutions_Thomsen_logit_TRUE.csv" is used in producing Figure 2 and Table 2 in the paper and the tables in Online appendix IV. 

ecolRxC_accuracy_Thomsen_probit_no_aprox.Rmd, ecolRxC_accuracy_Thomsen_probit_no_aprox.html
This document contains the reproducible code that produces the measures of accuracy corresponding to the estimates attained with the function ecolRxC() of the ecolRxC package with arguments method = "Thomsen", scale = "probit" and Yule.aprox = FALSE when applied to the datasets available in ei.Datasets. These measures of accuracy are saved in the files "summary_ecolRxC_solutions_Thomsen_probit_FALSE.csv" and "pjk_ecolRxC_predictions_Thomsen_probit_FALSE.csv". The data saved in "summary_ecolRxC_solutions_Thomsen_probit_FALSE.csv" is used in producing Figure 2 and Table 2 in the paper and the tables in Online appendix IV. The data saved in "pjk_ecolRxC_predictions_Thomsen_probit_FALSE.csv" is employed in producing Table 3 in the paper and the table in Online appendix V. The data saved in "summary_ecolRxC_solutions_Thomsen_probit_FALSE.csv" and "pjk_ecolRxC_predictions_Thomsen_probit_FALSE.csv" is used to produce Figure 3 in the paper.

ecolRxC_accuracy_Thomsen_probit_Yule_aprox.Rmd, ecolRxC_accuracy_Thomsen_probit_Yule_aprox.html
This document contains the reproducible code that produces the measures of accuracy corresponding to the estimates attained with the function ecolRxC() of the ecolRxC package with arguments method = "Thomsen", scale = "probit" and Yule.aprox = TRUE when applied to the datasets available in ei.Datasets. These measures of accuracy are saved in the files "summary_ecolRxC_solutions_Thomsen_probit_TRUE.csv". The data saved in "summary_ecolRxC_solutions_Thomsen_probit_TRUE.csv" is used in producing Figure 2 and Table 2 in the paper and the tables in Online appendix IV. 

Figure_2.Rmd, Figure_2.html
This document contains the reproducible code that produces Figure 2, displayed in Section 5 of the paper.

Figure_3.Rmd, Figure_3.html
This document contains the reproducible code that produces Figure 3, displayed in Section 5 of the paper.

Section_4_and_Online_appendix_III.Rmd, Section_4_and_Online_appendix_III.html
This document contains the reproducible code that produces Figure 1, displayed in Section 4 of the paper and the files "example_MT_lower.csv" and "example_MT_upper.csv" that contain the numbers presented in the table of Online appendix III. 

Table_2_and_tables_in_Online_appendix_IV.Rmd, Table_2_and_tables_in_Online_appendix_IV.html
This document contains the reproducible code that produces the numbers contained in Table 2 of Section 5 of the paper and the numbers of the tables of Online appendix IV. 

Table_3_and_tables_in_Online_appendix_V.Rmd, Table_3_and_tables_in_Online_appendix_V.html
This document contains the reproducible code that produces the numbers contained in Table 3 of Section 5 of the paper and the numbers of the tables of Online appendix V. 

